/**
 * There are <a href="https://www.hdzhx.com">邯郸智讯</a> code generation
 */
package com.boxin.ims.modules.wechat.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.BaseEntity;
import com.thinkgem.jeesite.modules.sys.entity.User;

/**
 * 秒杀配置Entity
 * @author Jakemanse
 * @version 2013-09-28
 */
@Entity
@Table(name = "wp_seckill_config")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class SeckillConfig extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 编号
	private User user; 		// 用户
	private String name; 	// 名称
	private Boolean startup;	//是否启动该活动
	private Boolean  cost;		//是否扣积分   0:不扣积分   1：扣积分
	private Integer costScore;	//扣的积分值 
	private Integer minScore;	//参与时的最低分数
	private Date createTime;	// 创建日期
	private Date updateTime;	//更新时间
	private Date startTime;		//开始时间
	private Date endTime;		//结束时间
	private String topPic;		//秒杀大图
	private String notice;		//公告
	private Integer validDays;	//有效时间(天)
	
	private String seckillTitle;	//微信中返回连接的标题
	private String seckillPic;		//返回微信的图片
	private String seckillDesc;		//图片的描述
	
	
	
	private String delFlag;	// 删除标记（0：正常；1：删除）
	private String remarks; // 备注
	
	
	

	public SeckillConfig() {
		this.createTime = new Date();
		this.delFlag = DEL_FLAG_NORMAL;
		validDays = 2;	//默认两天
	}

	public SeckillConfig(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_wechat_seckillConfig")
	//@SequenceGenerator(name = "seq_wechat_seckillConfig", sequenceName = "seq_wechat_seckillConfig")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne
	@JoinColumn(name="user_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@Length(min=1, max=200)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Length(min=0, max=255)
	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	
	@NotNull
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Length(min=1, max=1)
	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getTopPic() {
		return topPic;
	}

	public void setTopPic(String topPic) {
		this.topPic = topPic;
	}

	public String getNotice() {
		return notice;
	}

	public void setNotice(String notice) {
		this.notice = notice;
	}

	public Integer getValidDays() {
		return validDays;
	}

	public void setValidDays(Integer validDays) {
		this.validDays = validDays;
	}


	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Boolean getCost() {
		return cost;
	}

	public void setCost(Boolean cost) {
		this.cost = cost;
	}

	public Integer getCostScore() {
		return costScore;
	}

	public void setCostScore(Integer costScore) {
		this.costScore = costScore;
	}

	public Integer getMinScore() {
		return minScore;
	}

	public void setMinScore(Integer minScore) {
		this.minScore = minScore;
	}

	public String getSeckillTitle() {
		return seckillTitle;
	}

	public void setSeckillTitle(String seckillTitle) {
		this.seckillTitle = seckillTitle;
	}

	public String getSeckillPic() {
		return seckillPic;
	}

	public void setSeckillPic(String seckillPic) {
		this.seckillPic = seckillPic;
	}

	public String getSeckillDesc() {
		return seckillDesc;
	}

	public void setSeckillDesc(String seckillDesc) {
		this.seckillDesc = seckillDesc;
	}

	public Boolean getStartup() {
		return startup;
	}

	public void setStartup(Boolean startup) {
		this.startup = startup;
	}

	
	
	
}


